package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class Lend.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class Lend
{
    private ControlLayer.DVDCtr dVDCtr1;
    private ControlLayer.AddressCtr addressC1;
    private ControlLayer.LendCtr lendCtr1;

    /**
     * Default constructor for test class Lend
     */
    public Lend()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        dVDCtr1 = new ControlLayer.DVDCtr();
        dVDCtr1 = new ControlLayer.DVDCtr();
        dVDCtr1.createDVD(123, "123", "123", 15.09);
        dVDCtr1.createDVD(124, "124", "124", 22.09);
        dVDCtr1.listAllDvds();
        dVDCtr1.listAllCopies();
        dVDCtr1.createCopy(123, 222, 22.09, 55);
        dVDCtr1.listAllCopies();
        dVDCtr1.findDVD(234);
        dVDCtr1.listAllDvds();
        dVDCtr1.findDVD(124);
        dVDCtr1.getDVD(1);
        dVDCtr1.deleteDVD(124);
        dVDCtr1.listAllDvds();
        dVDCtr1.createDVD(125, "125", "125", 17.09);
        addressC1 = new ControlLayer.AddressCtr();
        addressC1.createPerson(123, "123", "123", "123", "123", "123");
        addressC1.createPerson(456, "456", "456", "456", "456", "456");
        addressC1.findPerson(123);
        lendCtr1 = new ControlLayer.LendCtr();
        lendCtr1.createLend(2222, 123, 222, "2 weeks", "30.09.2012");
        lendCtr1.listAllLends();
        lendCtr1.getLend(0);
        lendCtr1.listAllLends();
        dVDCtr1.listAllDvds();
        lendCtr1.returnLend(123, 222);
        lendCtr1.listAllLends();
        lendCtr1.createLend(2222, 123, 222, "2 weeks", "24.06.2012");
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }
}
